The Mac OS 8.5 Control Manager provides the following function for confirming the validity of a control handle:
IsValidControlHandle